from random import randint

n = randint(1, 16)

numbers = []

for i in range(n):
    numbers.append(randint(1, 1024))

print(numbers)


def sink(begin):
    if begin == n-1:
        return
    sink(begin+1)
    swap(begin, begin+1)


def swap(i, k):
    if numbers[i] > numbers[k]:
        tmp = numbers[i]
        numbers[i] = numbers[k]
        numbers[k] = tmp


for i in range(0, n):
    sink(i)

print(numbers)
